package TestDemo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("config.xml");

        GetStudent getStudent = new GetStudent(context.getBean("studentBean", StudentBean.class));
        StudentBean studentBean = getStudent.studentBean;
        System.out.println(studentBean.name + " || " + studentBean.age);

        studentBean.age = 10;
        studentBean.name = "李四";
        StudentBean studentBean1 = context.getBean("studentBean", StudentBean.class);

        System.out.println(studentBean1.name + " || " + studentBean1.age);
    }
}
